package day02;

public class gongyueshu {
 public static void main(String[] args) {
	 int a = Integer.parseInt(args[0]);
	 int b = Integer.parseInt(args[1]);
	 int x,y;
	 x=gys(a,b);
	 System.out.println(a+"和"+b+"最大公约数="+x);
	 y=gbs(a,b);
	 System.out.println(a+"和"+b+"最大公倍数="+y);
}
 private static int gys(int a,int b) {
	 int r;
	 int x=0;
	 int temp;
	 if(a<b)
	 {
		 temp=a;
		 a=b;
		 b=temp;
	 }
		 do
		 {
			 r=a%b;
			 a=b;
			 b=r;
		 }while(r!=0);
		 x=a;	 
	 
	 return x;
}
 private static int gbs(int a,int b) {
	 int y;
	 y=(a*b)/gys(a,b);
	 return y;
	
}
}
